<?php
require_once ('XingeApp.php');




class mobileapi_rpc_xinge extends mobileapi_frontpage{
	private $data_post; //post 过滤后的数组
	private $page_nums; //每页显示的条数
    private $offset;	//偏移量
    private $n_page;	//第几页
	private $where = 'WHERE 1';
	
	function __construct($app)
	{
		parent::__construct($app);		
		$this->app = $app;
		$this->verify_member();
        $this->member = $this->get_current_member();
		$this->app->rpcService = kernel::single('base_rpc_service');
        $this->pagesize = 10;
		
		
		$this->data_post = $this->check_input($_POST);
		//初始化分页处理
		if($this->data_post['page_no'] > 0){
			$this->data_post['n_page'] = $this->data_post['page_no'];
		}
		$this->page_nums = $this->data_post['page_nums']?$this->data_post['page_nums'] : 10;//默认10条
		$this->n_page = $this->data_post['n_page'] ? $this->data_post['n_page'] : 1;  
		$this->offset = ($this->n_page - 1) * $this->page_nums;
		if($this->data_post['order'] == 'null'){
			$this->data_post['orderby'] = '';
		}
		
	}

    function tuisong(){
          return 123;
    	 //var_dump(XingeApp::PushAllIos(2200090632,"e1378270db484874903605fc8b3f3130","大家好!",XingeApp::IOSENV_PROD));
    }

}
//Android 版
//给单个设备下发通知
var_dump(XingeApp::PushTokenAndroid(10000, "secretKey", "title", "content", "token"));
//给单个帐号下发通知
var_dump(XingeApp::PushAccountAndroid(10000, "secretKey", "title", "content", "account"));
//给所有设备下发通知
var_dump(XingeApp::PushAllAndroid(10000, "secretKey", "title", "content"));
//给标签选中设备下发通知
var_dump(XingeApp::PushTagAndroid(10000, "secretKey", "title", "content", "tag"));

//IOS版
//开发环境下 给单个设备下发通知
var_dump(XingeApp::PushTokenIos(10000, "secretKey", "content", "token", XingeApp::IOSENV_DEV));
//开发环境下 给单个帐号下发通知
var_dump(XingeApp::PushAccountIos(10000, "secretKey", "content", "account", XingeApp::IOSENV_DEV));
//开发环境下 给所有设备下发通知
var_dump(XingeApp::PushAllAndroid(10000, "secretKey", "content", XingeApp::IOSENV_DEV));
//开发环境下 给标签选中设备下发通知
var_dump(XingeApp::PushTagAndroid(10000, "secretKey", "content", "tag", XingeApp::IOSENV_DEV));